package com.dkh.recommend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 
 * @TableName tb_blog
 */
@TableName(value ="tb_blog")
@Data
public class TbBlog implements Serializable {
    /**
     * 故事blog主键
     */
    @TableId(type = IdType.AUTO)
    private Long blogId;

    /**
     * 故事内容
     */
    private String blogText;

    /**
     * 故事发布者Id
     */
    private Long blogAuthor;


    /**
     * 音乐Id
     */
    private Long musicId;

    /**
     * 音乐名称
     */
    private String musicName;

    /**
     * 浏览数量
     */
    private Integer pageView;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbBlog other = (TbBlog) that;
        return (this.getBlogId() == null ? other.getBlogId() == null : this.getBlogId().equals(other.getBlogId()))
            && (this.getBlogText() == null ? other.getBlogText() == null : this.getBlogText().equals(other.getBlogText()))
            && (this.getBlogAuthor() == null ? other.getBlogAuthor() == null : this.getBlogAuthor().equals(other.getBlogAuthor()))
            && (this.getMusicId() == null ? other.getMusicId() == null : this.getMusicId().equals(other.getMusicId()))
            && (this.getMusicName() == null ? other.getMusicName() == null : this.getMusicName().equals(other.getMusicName()))
            && (this.getPageView() == null ? other.getPageView() == null : this.getPageView().equals(other.getPageView()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBlogId() == null) ? 0 : getBlogId().hashCode());
        result = prime * result + ((getBlogText() == null) ? 0 : getBlogText().hashCode());
        result = prime * result + ((getBlogAuthor() == null) ? 0 : getBlogAuthor().hashCode());
        result = prime * result + ((getMusicId() == null) ? 0 : getMusicId().hashCode());
        result = prime * result + ((getMusicName() == null) ? 0 : getMusicName().hashCode());
        result = prime * result + ((getPageView() == null) ? 0 : getPageView().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", blogId=").append(blogId);
        sb.append(", blogText=").append(blogText);
        sb.append(", blogAuthor=").append(blogAuthor);
        sb.append(", musicId=").append(musicId);
        sb.append(", musicName=").append(musicName);
        sb.append(", pageView=").append(pageView);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}